﻿
<Window x:Class="PhotoDemo.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="PhotoDemo"
	xmlns:pd="clr-namespace:PhotoDemo"
	WindowState="Maximized"
	Loaded="WindowLoaded">

	<Window.Resources>
		<LinearGradientBrush x:Key="WindowGradient" StartPoint="0,0.3" EndPoint="1,0">
			<LinearGradientBrush.GradientStops>
				<GradientStop Color="#B2B6CAFF" Offset="0" />
				<GradientStop Color="#BFC3D5FF" Offset="0.1" />
				<GradientStop Color="#E0E4F0FF" Offset="0.3" />
				<GradientStop Color="#E6EAF5FF" Offset="0.5" />
				<GradientStop Color="#CFD7E2FF" Offset="0.6" />
				<GradientStop Color="#BFC5D3FF" Offset="0.8" />
				<GradientStop Color="#C4CBD8FF" Offset="1" />
			</LinearGradientBrush.GradientStops>
		</LinearGradientBrush>

		<LinearGradientBrush x:Key="ListBoxGradient" StartPoint="0,0" EndPoint="0,1">
			<LinearGradientBrush.GradientStops>
				<GradientStop Color="#90000000" Offset="0" />
				<GradientStop Color="#40000000" Offset="0.005" />
				<GradientStop Color="#10000000" Offset="0.04" />
				<GradientStop Color="#20000000" Offset="0.945" />
				<GradientStop Color="#60FFFFFF" Offset="1" />
			</LinearGradientBrush.GradientStops>
		</LinearGradientBrush>

		<LinearGradientBrush x:Key="ShoppingCartGradient" StartPoint="0,0" EndPoint="0,1">
			<LinearGradientBrush.GradientStops>
				<GradientStop Color="#90000000" Offset="0" />
				<GradientStop Color="#40000000" Offset="0.002" />
				<GradientStop Color="#10000000" Offset="0.02" />
				<GradientStop Color="#20000000" Offset="0.98" />
				<GradientStop Color="#60FFFFFF" Offset="1" />
			</LinearGradientBrush.GradientStops>
		</LinearGradientBrush>

		<LinearGradientBrush x:Key="ReflectionGradient" StartPoint="0,1" EndPoint="0,0">
			<LinearGradientBrush.GradientStops>
				<GradientStop Color="#50000000" Offset="0" />
				<GradientStop Color="Transparent" Offset=".5" />
			</LinearGradientBrush.GradientStops>
		</LinearGradientBrush>

		<LinearGradientBrush x:Key="ButtonGradient" StartPoint="0,0" EndPoint="0,1">
			<LinearGradientBrush.GradientStops>
				<GradientStop Color="#FDB6CADF" Offset="0" />
				<GradientStop Color="#FCC3C5FF" Offset="0.1" />
				<GradientStop Color="#FCC4D0EF" Offset="0.3" />
				<GradientStop Color="#FDB7C2DF" Offset="0.6" />
				<GradientStop Color="#FE95B3CF" Offset="0.8" />
				<GradientStop Color="#FE96AACF" Offset="1" />
			</LinearGradientBrush.GradientStops>
		</LinearGradientBrush>

		<LinearGradientBrush x:Key="VerticalScrollGradient" StartPoint="0,0" EndPoint="1,0">
			<LinearGradientBrush.GradientStops>
				<GradientStop Color="#FDB6CADF" Offset="0" />
				<GradientStop Color="#FCC3C5FF" Offset="0.1" />
				<GradientStop Color="#FCC4D0EF" Offset="0.3" />
				<GradientStop Color="#FDB7C2DF" Offset="0.6" />
				<GradientStop Color="#FE95B3CF" Offset="0.8" />
				<GradientStop Color="#FE96AACF" Offset="1" />
			</LinearGradientBrush.GradientStops>
		</LinearGradientBrush>

		<LinearGradientBrush x:Key="ComboBoxGradient" StartPoint="0,0" EndPoint="0,1">
			<LinearGradientBrush.GradientStops>
				<GradientStop Color="#B2B6CAFF" Offset="0" />
				<GradientStop Color="#B0B3C5FF" Offset="0.1" />
				<GradientStop Color="#BEE4E0FF" Offset="0.3" />
				<GradientStop Color="#B0D7E2FF" Offset="0.6" />
				<GradientStop Color="#B0C5D3FF" Offset="0.8" />
				<GradientStop Color="#C4CBD8FF" Offset="1" />
			</LinearGradientBrush.GradientStops>
		</LinearGradientBrush>

		<LinearGradientBrush x:Key="GreetingCardGradient" StartPoint="0,0" EndPoint="0,1">
			<LinearGradientBrush.GradientStops>
				<GradientStop Color="#EEEEEE" Offset="0" />
				<GradientStop Color="#FFFFFF" Offset="1" />
			</LinearGradientBrush.GradientStops>
		</LinearGradientBrush>

		<LinearGradientBrush x:Key="ButtonUpGradient" StartPoint="0,0" EndPoint="0,1">
			<LinearGradientBrush.GradientStops>
				<GradientStop Color="Transparent" Offset="0" />
				<GradientStop Color="#33000000" Offset="1" />
			</LinearGradientBrush.GradientStops>
		</LinearGradientBrush>

		<LinearGradientBrush x:Key="ButtonDownGradient" StartPoint="0,0" EndPoint="0,1">
			<LinearGradientBrush.GradientStops>
				<GradientStop Color="#10000000" Offset="0" />
				<GradientStop Color="#20000000" Offset="1" />
			</LinearGradientBrush.GradientStops>
		</LinearGradientBrush>

		<LinearGradientBrush x:Key="ButtonDisabledGradient" StartPoint="0,0" EndPoint="0,1">
			<LinearGradientBrush.GradientStops>
				<GradientStop Color="#10302A90" Offset="0" />
				<GradientStop Color="#10201040" Offset="1" />
			</LinearGradientBrush.GradientStops>
		</LinearGradientBrush>

		<!-- STYLES -->

		<Style TargetType="{x:Type pd:Window1}">
			<Setter Property="Background" Value="{DynamicResource WindowGradient}" />
		</Style>

		<Style x:Key="TitleText" TargetType="{x:Type TextBlock}" >
			<Setter Property="FontFamily" Value="Segoe Black" />
			<Setter Property="FontSize" Value="20px" />
			<Setter Property="Foreground" Value="MidnightBlue" />
		</Style>

		<!-- DATA TEMPLATES -->

		<DataTemplate DataType="{x:Type pd:ImageFile}">
			<Border VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4" Margin="2" Background="White">
				<Image Source="{Binding Image}" />
			</Border>
		</DataTemplate>

		<DataTemplate DataType="{x:Type pd:Print}">
			<Border Margin="3" VerticalAlignment="Center" HorizontalAlignment="Center" Background="White" Padding="3"  BorderBrush="#66000000" BorderThickness="1" MaxWidth="60" MaxHeight="60" >
				<Image Source="{Binding Photo}" />
			</Border>
		</DataTemplate>

		<DataTemplate DataType="{x:Type pd:GreetingCard}">
			<Grid Margin="3" >
				<Border VerticalAlignment="Center" HorizontalAlignment="Center" Background="{DynamicResource GreetingCardGradient}" Width="40" Height="50" BorderBrush="#44000000" BorderThickness="1" >
					<Border.RenderTransform>
						<SkewTransform AngleY="-10" />
					</Border.RenderTransform>
				</Border>
				<Border VerticalAlignment="Center" HorizontalAlignment="Center" Background="White" Width="50" Height="50" BorderBrush="#66000000" BorderThickness="1" >
					<Image Margin="3" Source="{Binding Photo}" />
				</Border>
			</Grid>
		</DataTemplate>

		<DataTemplate DataType="{x:Type pd:TShirt}">
			<Grid Margin="3">
				<Path VerticalAlignment="Center" HorizontalAlignment="Center" Fill="White" Stroke="#66000000"  Data="M 0 9.6 L 24 0 L 40 0 L 64 9.6 L 62.4 24 L 51.2 24 L 51.2 56 L 12.8 56 L 12.8 24 L 1.6 24 Z "/>
				<Image Source="{Binding Photo}"  MaxWidth="32" MaxHeight="36"  VerticalAlignment="Center" HorizontalAlignment="Center"/>
			</Grid>
		</DataTemplate>

		<!-- PHOTOLIST TEMPLATE -->

		<Style x:Key="PhotoListStyle" TargetType="{x:Type ListBox}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBox}" >
						<Border 
							BorderBrush="Gray" 
							BorderThickness="1" 
							CornerRadius="6" 
							Background="{DynamicResource ListBoxGradient}" >
							<ScrollViewer 
								VerticalScrollBarVisibility="Disabled" 
								HorizontalScrollBarVisibility="Auto">
								<StackPanel  
									IsItemsHost="True" 
									Orientation="Horizontal" 
									HorizontalAlignment="Left" />
							</ScrollViewer>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<!-- PHOTOLIST STORYBOARDS -->

		<Style x:Key="PhotoListItem" TargetType="{x:Type ListBoxItem}">
			<Setter Property="MaxHeight" Value="75" />
			<Setter Property="MinHeight" Value="75" />
			<Setter Property="Opacity" Value=".75" />
			<Style.Triggers>
				<EventTrigger RoutedEvent="Mouse.MouseEnter">
					<EventTrigger.Actions>
						<BeginStoryboard>
							<Storyboard>
								<DoubleAnimation 
									Duration="0:0:0.2" 
									Storyboard.TargetProperty="MaxHeight" 
									To="85" />
								<DoubleAnimation 
									Duration="0:0:0.2" 
									Storyboard.TargetProperty="Opacity"
									To="1.0" />
							</Storyboard>
						</BeginStoryboard>
					</EventTrigger.Actions>
				</EventTrigger>

				<EventTrigger RoutedEvent="Mouse.MouseLeave">
					<EventTrigger.Actions>
						<BeginStoryboard>
							<Storyboard>
								<DoubleAnimation 
									Duration="0:0:1" 
									Storyboard.TargetProperty="MaxHeight" />
								<DoubleAnimation 
									Duration="0:0:0.2" 
									Storyboard.TargetProperty="Opacity" />
							</Storyboard>
						</BeginStoryboard>
					</EventTrigger.Actions>
				</EventTrigger>
			</Style.Triggers>
		</Style>

		<!-- SHOPPING CART TEMPLATE -->

		<Style x:Key="ShoppingCartStyle" TargetType="{x:Type ListBox}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBox}" >
						<Border 
							BorderBrush="Gray" 
							BorderThickness="1" 
							CornerRadius="6" 
							Background="{DynamicResource ShoppingCartGradient}" >
							<ScrollViewer>
								<WrapPanel
									ItemHeight="70" 
									ItemWidth="70" 
									Margin="0,25,0,0"
									IsItemsHost="True" 
									Orientation="Horizontal" 
									HorizontalAlignment="Center"  />
							</ScrollViewer>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<!-- SHOPPING CART TRIGGERS -->

		<Style x:Key="ShoppingCartItem" TargetType="{x:Type ListBoxItem}">
			<Setter Property="BorderBrush" Value="Transparent" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBoxItem}">
						<Border 
							x:Name="ContentBorder" 
							Opacity="0.85">
							<ContentPresenter />
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsSelected" Value="True">
								<Setter 
									TargetName="ContentBorder" 
									Property="Opacity" 
									Value="1.0" />
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<!-- BUTTON TEMPLATE -->

		<Style TargetType="{x:Type Button}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Border x:Name="OuterBorder"
							CornerRadius="3" 
							Background="{DynamicResource ButtonGradient}">
							<Border
								x:Name="InnerBorder"
								CornerRadius="3"
								Background="{DynamicResource ButtonUpGradient}"
								Padding="{TemplateBinding Padding}">
								<ContentPresenter x:Name="ContentSite" 
								HorizontalAlignment="Center" 
								VerticalAlignment="Center" />
							</Border>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsPressed" Value="true">
								<Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource ButtonDownGradient}" />
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource ButtonDisabledGradient}"  />
								<Setter Property="BorderBrush" Value="Silver"  />
								<Setter Property="Foreground" Value="SlateGray"  />
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="Height" Value="18" />
			<Setter Property="Foreground" Value="MidnightBlue" />
		</Style>

		<!-- COMBOBOX STYLE -->

		<Style TargetType="{x:Type ComboBox}" >
			<Setter Property="Background" Value="{DynamicResource ComboBoxGradient}" />
			<Setter Property="BorderThickness" Value="0" />
			<Setter Property="Height" Value="18px" />
			<Setter Property="Foreground" Value="MidnightBlue" />
		</Style>

		<!-- PROGRESS BAR STYLE -->

		<Style TargetType="{x:Type ProgressBar}" >
			<Setter Property="Background" Value="{DynamicResource ComboBoxGradient}" />
			<Setter Property="BorderThickness" Value="1" />
			<Setter Property="BorderBrush" Value="Gray" />
			<Setter Property="Foreground" Value="MidnightBlue" />
		</Style>

		<!-- SCROLLBAR TEMPLATES -->

		<Style x:Key="Scrollbar_LineButton" TargetType="{x:Type RepeatButton}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type RepeatButton}">
						<Border 
							BorderBrush="Transparent" 
							BorderThickness="1" 
							CornerRadius="6" 
							Background="{DynamicResource ButtonGradient}">
							<ContentPresenter x:Name="ContentSite" />
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="MinHeight" Value="12" />
			<Setter Property="MinWidth" Value="12" />
			<Setter Property="Foreground" Value="Gray" />
			<Setter Property="FontSize" Value="6pt" />
			<Setter Property="FontWeight" Value="Bold" />
			<Setter Property="FontFamily" Value="Lucida Sans" />
			<Setter Property="VerticalAlignment" Value="Center" />
			<Setter Property="HorizontalAlignment" Value="Center" />
		</Style>

		<Style x:Key="ScrollBar_TrackRepeater"  TargetType="{x:Type RepeatButton}">
			<Setter Property="IsTabStop" Value="false" />
			<Setter Property="Focusable" Value="false" />
			<Setter Property="Command" Value="ScrollBar.PageUpCommand" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type RepeatButton}">
						<Rectangle Fill="Transparent" />
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<Style x:Key="ScrollBar_UpTrack" BasedOn="{StaticResource ScrollBar_TrackRepeater}" TargetType="{x:Type RepeatButton}">
			<Setter Property="Command" Value="ScrollBar.PageUpCommand" />
		</Style>

		<Style x:Key="ScrollBar_DownTrack" BasedOn="{StaticResource ScrollBar_TrackRepeater}" TargetType="{x:Type RepeatButton}">
			<Setter Property="Command" Value="ScrollBar.PageDownCommand" />
		</Style>

		<Style x:Key="ScrollBar_LeftTrack" BasedOn="{StaticResource ScrollBar_TrackRepeater}" TargetType="{x:Type RepeatButton}">
			<Setter Property="Command" Value="ScrollBar.PageLeftCommand" />
		</Style>

		<Style x:Key="ScrollBar_RightTrack" BasedOn="{StaticResource ScrollBar_TrackRepeater}" TargetType="{x:Type RepeatButton}">
			<Setter Property="Command" Value="ScrollBar.PageRightCommand" />
		</Style>

		<Style x:Key="ScrollBar_VerticalThumb" TargetType="{x:Type Thumb}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Thumb}">
						<Border CornerRadius="6" 
							BorderBrush="Transparent"     
							BorderThickness="1" 
							Background="{DynamicResource VerticalScrollGradient}" />
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="MinHeight" Value="10" />
			<Setter Property="MinWidth" Value="10" />
		</Style>

		<Style x:Key="ScrollBar_HorizontalThumb" TargetType="{x:Type Thumb}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Thumb}">
						<Border CornerRadius="6" 
							BorderBrush="Transparent"     
							BorderThickness="1" 
							Background="{DynamicResource ButtonGradient}" />
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="MinHeight" Value="10" />
			<Setter Property="MinWidth" Value="10" />
		</Style>

		<Style TargetType="{x:Type ScrollBar}">
			<Setter Property="Background" Value="Transparent" />
			<Setter Property="MinWidth" Value="10" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ScrollBar}">
						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="10"/>
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="10" />
								<RowDefinition Height="*"/>
								<RowDefinition Height="10" />
							</Grid.RowDefinitions>
							<Border Grid.Row="1" BorderThickness="0" Background="Transparent" CornerRadius="4"/>
							<RepeatButton Grid.Row="0" Style="{DynamicResource Scrollbar_LineButton}" Command="ScrollBar.LineUpCommand" Content=" ^" />
              <Track Grid.Row="1" Name="PART_Track"  IsDirectionReversed="True">
                <Track.IncreaseRepeatButton>
                  <RepeatButton Style="{DynamicResource ScrollBar_DownTrack}"/>
                </Track.IncreaseRepeatButton>
                <Track.DecreaseRepeatButton>
                  <RepeatButton Style="{DynamicResource ScrollBar_UpTrack}"/>
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                  <Thumb Style="{DynamicResource ScrollBar_VerticalThumb}"/>
                </Track.Thumb>
              </Track>
							<RepeatButton Grid.Row="2" Style="{DynamicResource Scrollbar_LineButton}" Command="ScrollBar.LineDownCommand" Content=" v" />
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Style.Triggers>
				<Trigger Property="Orientation" Value="Horizontal" >
					<Setter Property="Background" Value="Transparent" />
					<Setter Property="MinHeight" Value="10" />
					<Setter Property="Template">
						<Setter.Value>
							<ControlTemplate TargetType="{x:Type ScrollBar}">
								<Grid>
									<Grid.RowDefinitions>
										<RowDefinition Height="12"/>
									</Grid.RowDefinitions>
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="12" />
										<ColumnDefinition Width="*"/>
										<ColumnDefinition Width="12" />
									</Grid.ColumnDefinitions>
									<Border Grid.Column="1" BorderThickness="0" Background="Transparent" CornerRadius="4"/>
									<RepeatButton Grid.Column="0" Style="{DynamicResource Scrollbar_LineButton}" Command="ScrollBar.LineLeftCommand" Content=" &lt;" />
                  <Track Grid.Column="1" Name="PART_Track">
                    <Track.IncreaseRepeatButton>
                      <RepeatButton Style="{DynamicResource ScrollBar_RightTrack}"/>
                    </Track.IncreaseRepeatButton>
                    <Track.DecreaseRepeatButton>
                      <RepeatButton Style="{DynamicResource ScrollBar_LeftTrack}"/>
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                      <Thumb Style="{DynamicResource ScrollBar_HorizontalThumb}"/>
                    </Track.Thumb>
                  </Track>
									<RepeatButton Grid.Column="2" Style="{DynamicResource Scrollbar_LineButton}" Command="ScrollBar.LineRightCommand" Content=" &gt;" />

								</Grid>
							</ControlTemplate>
						</Setter.Value>
					</Setter>
				</Trigger>
			</Style.Triggers>
		</Style>
	</Window.Resources>

	<Viewbox VerticalAlignment="Top" Stretch="Uniform">

		<Grid Margin="20" Width="620" ShowGridLines="False" >
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto" />
				<RowDefinition Height="120" />
				<RowDefinition Height="Auto" />
				<RowDefinition Height="250" />
				<RowDefinition Height="15" />
				<RowDefinition Height="Auto" />
				<RowDefinition Height="*" />
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition/>
				<ColumnDefinition Width="400" />
				<ColumnDefinition Width="160" />
			</Grid.ColumnDefinitions>

			<TextBlock Grid.Row="0" Grid.ColumnSpan="3" Style="{DynamicResource TitleText}">
				<Span>Order Prints and Gifts</Span>
			</TextBlock>

			<ListBox Style="{DynamicResource PhotoListStyle}" 
				Grid.Row="1" 
				Grid.ColumnSpan="3" 
				Name ="PhotoListBox" 
				Margin="0,0,0,20" 
				DataContext="{Binding Source={StaticResource Photos}}" 
				SelectionChanged ="PhotoListSelection" 
				ItemsSource="{Binding }" 
				ItemContainerStyle="{DynamicResource PhotoListItem}" 
				SelectedIndex="0" />

			<StackPanel
				Grid.Row="3" Grid.Column="0">

				<Button 
				Name="RotateButton" 
				VerticalAlignment="Bottom" 
				HorizontalAlignment="Center" 
				Click="Rotate" 
				Width="55"  				
				Margin="2">
					Rotate
				</Button>

				<Button 
				Name="BWButton" 
				VerticalAlignment="Bottom" 
				HorizontalAlignment="Center" 
				Click="BlackAndWhite" 
				Width="55"  				
				Margin="2">
					B&amp;W
				</Button>

				<Button 
				Name="CropButton"
				VerticalAlignment="Bottom" 
				HorizontalAlignment="Center" 
				Click="Crop" 
				Width="55"  				
				Margin="2">
					Crop
				</Button>

			</StackPanel>

			<Button Grid.Row="3" Grid.Column="0"
			Name="UndoButton" 
			VerticalAlignment="Bottom" 
			HorizontalAlignment="Center" 
			Click="Undo" 
			IsEnabled="False" 
			Width="55"  				
			Margin="2">
				Undo
			</Button>

			<Image Name="CurrentPhoto" 
				Grid.Row="3" 
				Grid.Column="1" 
				Margin="10" 
				MouseDown="OnMouseDown"/>

			<Grid 
				Grid.Row="5" Grid.Column="1" 
				HorizontalAlignment="Center" 
				Margin="0">
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto"/>
					<RowDefinition Height="Auto"/>
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition/>
					<ColumnDefinition/>
				</Grid.ColumnDefinitions>

				<ComboBox
					Grid.Row="0" Grid.Column="0" 
					Margin="0,0,4,0" 
					VerticalAlignment="Center" 
					Name="PrintTypeComboBox" 
					DataContext="{Binding Source={StaticResource PrintTypes}}"
					ItemsSource="{Binding}" 
					Width="110" 
					SelectedIndex="0" />

				<Button 
					Grid.Row="0" Grid.Column="1" 
					Click="AddToShoppingCart" 
					VerticalAlignment="Center" 
					Width="100"  
					IsDefault="True">
					Add To Cart
				</Button>

				<Button 
					Grid.Row="1" Grid.Column="1" 
					Name="RemoveButton" 
					Click="RemoveShoppingCartItem" 
					VerticalAlignment="Center" 
					IsEnabled="False" 
					Width="100" 
					Margin="10" >
					Remove Item
				</Button>

			</Grid>

			<Grid Grid.Row="3" Grid.Column="2">
				<Grid.RowDefinitions>
					<RowDefinition Height="20" />
					<RowDefinition />
				</Grid.RowDefinitions>
				<TextBlock Grid.Row="0"
					Foreground="MidnightBlue" 
					FontSize="13px" 
					Margin="2" 
					HorizontalAlignment="Center">
					Shopping Cart
				</TextBlock>
				<ListBox ScrollViewer.HorizontalScrollBarVisibility="Disabled" Style="{DynamicResource ShoppingCartStyle}" 
					Name="ShoppingCartListBox" 
					Grid.Row="1" 
					Width="160" 
					DataContext="{Binding Source={StaticResource ShoppingCart}}" 
					ItemContainerStyle="{DynamicResource ShoppingCartItem}" 
					ItemsSource="{Binding}" />
			</Grid>
			
			<StackPanel
				Grid.Row="5" Grid.Column="2"  >
				<Button 
					Name="UploadButton"
					Click="Upload" 
					VerticalAlignment="Bottom" 
					HorizontalAlignment="Center" 
					Width="100"  				
					Margin="2"
					IsEnabled="False">
					Upload
				</Button>

				<ProgressBar 
					Name="UploadProgressBar" 
					Grid.Row="6"
					Grid.Column="2"
					VerticalAlignment="Top" 
					Margin="0,10,0,0" />
			</StackPanel>
		</Grid>
	</Viewbox>
</Window>
